// 题意：找无环k短路
//
// 题解：看wiki，用了yen算法
//       https://en.wikipedia.org/wiki/Yen%27s_algorithm
//       sgu的spj有点问题。待解决。
//
// std: c++03
// run: $exec < input
#include <iostream>
#include <cassert>
#include <stack>
#include <vector>
#include <list>
#include <algorithm>
#include <utility>
#include <queue>

struct edge {
	edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
	int from, to, cost;
};

bool operator<(edge const & a, edge const & b)
{
	return a.cost > b.cost;
}

struct source_to_node
{
	source_to_node(int node, int dis) : node(node), dis(dis) {}
	explicit source_to_node() {}
	int node, dis;
};

typedef std::list<edge> adj_edge;
typedef std::vector<adj_edge> graph_type;
typedef std::vector<source_to_node> path_type;
typedef adj_edge::iterator edge_iter;

graph_type graph;

int n, m, k, s, t;

int const inf = 1<<28;
int const maxn = 200;

std::vector<bool> unit_deleted_node(maxn);
std::vector<std::vector<bool> > unit_deleted_edge(maxn);

int dijkstra(graph_type & graph, int source, int target,
		path_type & path,
		std::vector<bool> const & deleted_node = unit_deleted_node,
		std::vector<std::vector<bool> > const & deleted_edge = unit_deleted_edge)
{
	int nv = graph.size();
	int dist[nv], come_from[nv];
	std::fill(dist, dist + nv, inf);
	std::fill(come_from, come_from + nv, -1);
	dist[source] = 0;
	std::priority_queue<edge> pq;
	pq.push(edge(-1, source, 0));
	while (!pq.empty()) {
		edge tmp = pq.top(); pq.pop();
		int u = tmp.to;
		if (dist[u] < tmp.cost) continue;
		come_from[u] = tmp.from;
		for (edge_iter it = graph[u].begin(); it != graph[u].end(); ++it) {
			int v = (*it).to, c = (*it).cost;
			if (deleted_node[v] || deleted_edge[u][v]) continue;
			if (dist[v] > dist[u] + c) {
				dist[v] = dist[u] + c;
				pq.push(edge(u, v, dist[v]));
			}
		}
	}
	std::stack<source_to_node> tmp;
	for (int i = target; i != -1; i = come_from[i]) {
		tmp.push(source_to_node(i, dist[i]));
	}

	for (; !tmp.empty(); tmp.pop()) path.push_back(tmp.top());
	return dist[target];
}

bool equal(path_type const & now, path_type const & prev)
{
	if (prev.size() < now.size()) return false;
	for (int i = 0; i < (int)now.size(); i++)
		if (now[i].node != prev[i].node) return false;
	return true;
}

struct sp // shortest path
{
	int dis;
	path_type path;
};

bool operator<(sp const & a, sp const & b)
{
	return a.dis > b.dis;
}

sp yen_ksp(graph_type & graph, int s, int t, int k)
{
	std::vector<sp> all(k);
	all[0].dis = dijkstra(graph, s, t, all[0].path);
	std::priority_queue<sp> b;

	for (int now = 1; now < k; now++) {
		for (int i = 0; i < (int)all[now-1].path.size() - 1; i++) {
			int super_node = all[now-1].path[i].node;
			path_type root_path(all[now-1].path.begin(), all[now-1].path.begin() + i+1);
			std::vector<bool> tmp_deleted_node(n);
			std::vector<std::vector<bool> > tmp_deleted_edge(n);
			for (int ti = 0; ti < n; ti++) tmp_deleted_edge[ti].resize(n);

			for (int ti = 0; ti < now; ti++)
				if (equal(root_path, all[ti].path))
					tmp_deleted_edge[ all[ti].path[i].node ][ all[ti].path[i+1].node ] =
						tmp_deleted_edge[ all[ti].path[i+1].node ][ all[ti].path[i].node ] = true;

			for (int ti = 0; ti < (int)root_path.size(); ti++)
				tmp_deleted_node[root_path[ti].node] = true;

			sp path_now;
			path_type super_path;
			path_now.dis = dijkstra(graph, super_node, t, super_path, tmp_deleted_node, tmp_deleted_edge);
			path_now.dis += all[now-1].path[i].dis;
			path_now.path = root_path;

			for (int i = 1; i < (int)super_path.size(); i++)
				path_now.path.push_back(super_path[i]);

			b.push(path_now);
		}

		assert(!b.empty()); // This handles the case of there being no spur paths, or no spur paths left.
							// his could happen if the spur paths have already been exhausted (added to A), 
							// or there are no spur paths at all - such as when both the source and sink vertices
							// lie along a "dead end".
		all[now] = b.top();
		b.pop();
	}
	return all[k-1];
}

void print(path_type const & path)
{
	std::cout << path[0].node + 1;
	for (int i = 1; i < (int)path.size(); i++)
		std::cout << ' ' << path[i].node + 1;
	std::cout << '\n';
}

int main()
{
	// init
	for (int i = 0; i < maxn; i++) unit_deleted_edge[i].resize(maxn);

	std::ios::sync_with_stdio(false);
	std::cin >> n >> m >> k;
	graph.resize(n);
	for (int i = 0, x, y, z; i < m; i++) {
		std::cin >> x >> y >> z;
		x--; y--;
		graph[x].push_back(edge(x, y, z));
		graph[y].push_back(edge(y, x, z));
	}
	std::cin >> s >> t;
	s--; t--;

	sp k_path = yen_ksp(graph, s, t, k);
	std::cout << k_path.dis << ' ' << k_path.path.size() << '\n';
	print(k_path.path);
}

